﻿/********************************************************************************************
 * Time de desenvolvedores
 *  Vinícius Batista de Souza       @vbs_br
 *  Fermando Martin Figuera         @fernandomartin
 *  
 *  
 * Jogo desenvolvido para testar algumas features e produzir trilha de treinamento no MSDN.
 * Faça o download do SDK do Windows Phone, faça você também o seu jogo :)
 * 
 * Dúvidas utilizem o Forúm do Windows Phone no MSDN.
********************************************************************************************/



using System;
using System.Windows;
using System.Windows.Threading;
using Microsoft.Xna.Framework;


namespace ComboBUG
{
    public class XnaFrameworkDispatcherService : IApplicationService
    {

        DispatcherTimer timer;
        public XnaFrameworkDispatcherService()
        {
            timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromTicks(333333);
            timer.Tick += OnTimerTick;
            FrameworkDispatcher.Update();
        }
        void OnTimerTick(object sender, EventArgs args)
        {
            FrameworkDispatcher.Update();
        }
        void IApplicationService.StartService(ApplicationServiceContext context) { timer.Start(); }
        void IApplicationService.StopService()
        {
            timer.Stop();
        }


    }
}

